package com.tengju.user.infrastructure.repository.club.convert;

import com.tengju.user.domain.model.club.ClubId;
import com.tengju.user.domain.model.club.ClubZoneRelation;
import com.tengju.user.domain.model.club.ZoneId;
import com.tengju.user.infrastructure.persistence.mybatis.dataobject.ClubZoneRelationDO;

public class ClubZoneRelationConvert {

    public static ClubZoneRelation convert(ClubZoneRelationDO clubZoneRelationDO) {
        if (clubZoneRelationDO == null) {
            return null;
        }
        return new ClubZoneRelation(
                new ClubId(clubZoneRelationDO.getClubId()),
                new ZoneId(clubZoneRelationDO.getZoneId()),
                clubZoneRelationDO.getCreateBy(),
                clubZoneRelationDO.getUpdateBy()
        );
    }
}
